import java.util.Scanner;

//针对每行输入，输出用“*”组成的X形图案
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()){
            int n = scanner.nextInt();
            if (n % 2 == 0) {
                for (int i = 1; i <= n; i++) {
                    if(i <= n/2){
                        for (int j1 = 1; j1 < i; j1++) {
                            System.out.print(" ");
                        }
                    }else{
                        for (int j1 = 1; j1 <= n-i; j1++) {
                            System.out.print(" ");
                        }
                    }
                    System.out.print("*");
                    for (int j2 = 0; j2 < n-2*i; j2++) {
                        System.out.print(" ");
                    }
                    for (int j3 = 0; j3 < 2*(i-1)-n; j3++) {
                        System.out.print(" ");
                    }
                    System.out.print("*\n");
                }
            }else{
                for (int i = 1; i <= n; i++) {
                    if(i <= n/2){
                        for (int j1 = 1; j1 < i; j1++) {
                            System.out.print(" ");
                        }
                    }else{
                        for (int j1 = 1; j1 <= n-i; j1++) {
                            System.out.print(" ");
                        }
                    }
                    if(i==(n/2+1)){
                        System.out.print("*\n");
                    }else{
                        System.out.print("*");
                        for (int j2 = 0; j2 < n-2*i; j2++) {
                            System.out.print(" ");
                        }
                        for (int j3 = 0; j3 < 2*(i-1)-n; j3++) {
                            System.out.print(" ");
                        }
                        System.out.print("*\n");
                    }
                }
            }

        }
    }

    //求出0-100中既能被3整除又能被5整除的数
    public static void main1(String[] args) {
        int i = 1;
        while(i <= 100){
            if(i % 15 == 0){
                System.out.println(i);
                i++;
                continue;
            }else{
                i++;
            }
        }
    }

    //编写程序数一下 1到 100 的所有整数中出现多少个数字9
    public static void main2(String[] args) {
        int count = 0;
        for (int i = 0; i < 100; i++) {
            if(i%10 == 9){
                count++;
            }
            if(i/10 == 9){
                count++;
            }
        }
        System.out.print("0-100中出现9的次数为：");
        System.out.println(count);
    }

    //判断素数：给定一个数字，判定一个数字是否是素数
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入要判断的数：");
        int num = scanner.nextInt();

        int i = 0;
        for (i = 2; i < num; i++) {
            if(num%i == 0){
                System.out.println("该数不是素数");
                break;
            }
        }

        if(i == num){
            System.out.println("该数是素数");
        }
    }

    //求最大公约数：给定两个数，求这两个数的最大公约数
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入两个数：");
        int a = scanner.nextInt();
        scanner.nextLine();
        int b = scanner.nextInt();

        //判断谁大谁小，将大的数赋值给a
        if(a < b){
            int temp = 0;
            temp = a;
            a = b;
            b = temp;
        }

        //辗转相除法
        int r = 0;
        do{
            r = a%b;
            a = b;
            b = r;
        }while (r != 0);
        System.out.print("最大公约数是：");
        System.out.println(a);
    }

    //计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值
    public static void main5(String[] args) {
        float i = 0;
        float sum = 0;
        for(i = 1;i <= 100;i++){
            if(i%2 == 1){
                sum += 1/i;
            }else {
                sum -= 1 / i;
            }
        }
        System.out.print("分数的和是：");
        System.out.println(sum);
    }

    //输出n*n的乘法口诀表，n由用户输入
    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入n的值：");
        int n = scanner.nextInt();
        for(int i = 1;i <= n;i++){
            for(int j = 1;j <= i;j++){
                System.out.printf("%2d*%2d=%2d    ",j,i,i*j);
            }
            System.out.println("\n");
        }
    }

    //编写代码模拟三次密码输入的场景。 最多能输入三次密码，密码正确，提示“登录成功”,密码错误， 可以重新输 入，最多输入三次。三次均错，则提示退出程序
    public static void main7(String[] args) {
        String kwd = "123";
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入密码：");
        for (int i = 0; i < 3; i++) {
            String pwd = scanner.next();
            if(pwd.equals(kwd)){
                System.out.println("登陆成功");
                break;
            }else if(i<2){
                System.out.println("密码错误，登陆失败，请重新输入：");
            }else{
                System.out.println("三次密码错误，退出程序");
            }
        }
    }
}

